import Layout from '@/layout/index.vue'

//对外暴露配置路由(常量路由)
export const constantRoute = [
    {
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        name: 'login',
        meta: {
            title: '登录',
            hidden: true
        }
    },
    {
        path: '/',
        component: Layout,
        redirect: '/home',
        children: [
            {
                path: 'home',
                component: () => import('@/views/home/index.vue'),
                name: 'home',
                meta: {
                    title: '首页'
                }
            }
        ]
    },
    {
        path: '/category',
        component: Layout,
        children: [
            {
                path: '',
                component: () => import('@/views/category/index.vue'),
                name: 'Category',
                meta: {
                    title: '分类管理'
                }
            }
        ]
    },
    {
        path: '/product',
        component: Layout,
        children: [
            {
                path: '',
                component: () => import('@/views/product/index.vue'),
                name: 'Product',
                meta: {
                    title: '商品管理'
                }
            }
        ]
    },
    {
        path: '/order',
        component: Layout,
        children: [
            {
                path: '',
                component: () => import('@/views/order/index.vue'),
                name: 'Order',
                meta: {
                    title: '订单管理'
                }
            }
        ]
    },
    {
        path: '/user',
        component: Layout,
        children: [
            {
                path: '',
                component: () => import('@/views/user/index.vue'),
                name: 'User',
                meta: {
                    title: '用户管理'
                }
            }
        ]
    },
    {
        path: '/404',
        component: () => import('@/views/404/index.vue'),
        name: '404',
        meta: {
            title: '404',
            hidden: true
        }
    },
    {
        path: '/:pathMatch(.*)*',
        redirect: '/404',
        name: 'Any',
        meta: {
            hidden: true
        }
    }
]